package com.proposition.paper.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.proposition.commons.enums.PaperPattern;
import com.proposition.commons.enums.PaperType;
import com.proposition.commons.model.Paper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ${DESCRIPTION}
 *
 * @author 杨凯
 * @create 2017-11-06 10:38
 **/
@Mapper
public interface PaperMapper extends BaseMapper<Paper> {


	/**
	 * 获取本年度所有试题ID
	 *
	 * @param year
	 * @return
	 */

	List<String> selectPaperIdByYear(@Param("year") int year);

	/**
	 * 获取试卷年度列表
	 *
	 * @return
	 */
	List<String> selectYearList();

	/**
	 * 检查试题是否已使用
	 *
	 * @param paperPattern
	 * @param year
	 * @param batch
	 * @return
	 */
	List<String> checkExamIsUse(@Param("paperPattern") PaperPattern paperPattern, @Param("year") int year,@Param("batch") int batch);


	/**
	 * 获取试卷最新批次
	 * @param paperPattern
	 * @param paperType
	 * @param year
	 * @return
	 */
	Paper selectBatch(@Param("paperPattern") PaperPattern paperPattern, @Param("paperType") PaperType paperType, @Param("year") int year);


}
